package com.liukunup.start.bean;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 接口响应
 * @author Liu Kun
 * @date 2021-03-25 00:15:30
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ApiResult implements Serializable {
    /**
     * 响应码
     */
    private Integer code;
    /**
     * 处理是否成功
     */
    private Boolean success;
    /**
     * 返回消息
     */
    private String message;
    /**
     * 返回数据
     */
    private Object data;

    /**
     * 快速设置返回的构造函数
     * @param code    响应码
     * @param success 是否成功
     */
    public ApiResult(Integer code, Boolean success) {
        this.code = code;
        this.success = success;
    }
}
